﻿using System.Web.Security;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Marbles.CMS.Core
{
    public class SiteController
    {

        public static void Logout()
        {
            FormsAuthentication.SignOut();
            HttpContext.Current.Session.Clear();
            HttpContext.Current.Session.Abandon();
        }

        public static void Login(string UserName, int SessionTimeOut)
        {
            FormsIdentity formsId = null;
            FormsAuthenticationTicket authenticationTicket = null;
            authenticationTicket = new FormsAuthenticationTicket(UserName, true, SessionTimeOut);
            formsId = new FormsIdentity(authenticationTicket);
            FormsAuthentication.SetAuthCookie(UserName, true);
        }

    }
}
